diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2023-12-06 20:21:26 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2023-12-06 20:21:26 -0500 |
| commit | 57899b0160385c53df4e43ef2fd12492e0dffb77 (patch) | |
| tree | 83f616c406c2d37aec2250bb0c44fcb8d701c177 /src/app/groups/[groupId]/reimbursement-list.tsx | |
| parent | 6ce2329f5ce20f8352e3ea15594f2532ab8a392c (diff) | |
Reimbursements
Diffstat (limited to 'src/app/groups/[groupId]/reimbursement-list.tsx')
| -rw-r--r-- | src/app/groups/[groupId]/reimbursement-list.tsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/app/groups/[groupId]/reimbursement-list.tsx b/src/app/groups/[groupId]/reimbursement-list.tsx index 9d3ec49..3fc94bc 100644 --- a/src/app/groups/[groupId]/reimbursement-list.tsx +++ b/src/app/groups/[groupId]/reimbursement-list.tsx @@ -1,16 +1,20 @@ +import { Button } from '@/components/ui/button' import { Reimbursement } from '@/lib/balances' import { Participant } from '@prisma/client' +import Link from 'next/link' type Props = { reimbursements: Reimbursement[] participants: Participant[] currency: string + groupId: string } export function ReimbursementList({ reimbursements, participants, currency, + groupId, }: Props) { const getParticipant = (id: string) => participants.find((p) => p.id === id) return ( @@ -20,6 +24,13 @@ export function ReimbursementList({ <div> <strong>{getParticipant(reimbursement.from)?.name}</strong> owes{' '} <strong>{getParticipant(reimbursement.to)?.name}</strong> + <Button variant="link" asChild className="-my-3"> + <Link + href={`/groups/${groupId}/expenses/create?reimbursement=yes&from=${reimbursement.from}&to=${reimbursement.to}&amount=${reimbursement.amount}`} + > + Mark as paid + </Link> + </Button> </div> <div> {currency} {reimbursement.amount.toFixed(2)} |
